package com.tarena.lbs.user.dao.repository;

import com.github.pagehelper.PageInfo;
import com.tarena.lbs.base.protocol.exception.BusinessException;
import com.tarena.lbs.user.pojo.po.AdminPO;
import com.tarena.lbs.user.pojo.query.AdminQuery;

import java.util.List;

public interface AdminRepository {

    AdminPO getAdminByPhone(String phone);

    AdminPO getAdminById(Integer id);

    PageInfo<AdminPO> pagesList(AdminQuery query);

    void save(AdminPO adminPO) throws BusinessException;

    void update(AdminPO adminPO) throws BusinessException;

    void delete(Integer id) throws BusinessException;


    void updateStatus(Integer id, Integer status) throws BusinessException;

    /**
     * 重置管理员密码
     * @param id 管理员ID
     * @throws BusinessException 业务异常
     */
    void resetPassword(Integer id) throws BusinessException;

    void batchDelete(List<Integer> ids) throws BusinessException;

    /**
     * 为管理员分配角色
     * @param id 管理员ID
     * @param accountType 角色类型
     * @throws BusinessException 业务异常
     */
    void assignRole(Integer id, Integer accountType, Integer businessId) throws BusinessException;

    int deleteAdmin(Integer id);
}
